<template>
  <span class="box">
    <el-button :title="name"
      @click="$download.preview(path, name)"
      type="text"
    >{{name}}</el-button>
    <i
      @click="$download.download(path, name)"
      class="el-icon-download"
    ></i>
  </span>
</template>

<script>
export default {
  props: {
    path: {
      type: String,
      default: "",
    },
    name: {
      type: String,
      default: "",
    },
  },
  data() {
    return {};
  },
  methods: {},
};
</script>

<style lang="scss" scoped>
.box {
  padding: 0 5px;
  display: flex;
  align-items: center;
}
.el-button {
  overflow: hidden; /*超出部分隐藏*/
  text-overflow: ellipsis; /* 超出部分显示省略号 */
  white-space: nowrap; /*规定段落中的文本不进行换行 */
}
.el-icon-download {
  vertical-align: middle;
  font-size: 18px;
  cursor: pointer;
  color: #195fff;
  &:hover {
    color: #5185ff;
  }
}
</style>
